# -*- coding:utf-8 -*-
import os
import re


def ReadFile(filePath):
    with open(filePath,"r",encoding="utf-8") as f:
        return f.read()
 
def WriteFile(filePath,u):
    with open(filePath,"wb") as f:
        f.write(u.encode(encoding="gb18030",errors="ignore"))
 
def UTF8_2_GBK(src,dst):
    content = ReadFile(src)
    WriteFile(dst,content)

if __name__ == '__main__':
    UTF8_2_GBK("write_chinese_py2.py","write_chinese_py2_2.py")    
